import java.io.PrintWriter;
import java.util.HashMap;

class StatementList extends Node {

	private Node stat_;
	private Node stat_list_;

	public StatementList(Node s, Node ss) {
		stat_ = s;
		stat_list_ = ss;
	}

	public StatementList(Node s) {
		stat_ = s;
	}

	@Override
	public void print(PrintWriter pw) {
		pw.println("Node name : StatementList");
		System.out.println("stat_: " + stat_);
		stat_.print(pw);
		if (stat_list_ != null) {
			stat_list_.print(pw);
		}
	}

	public String translate(HashMap<String, PrintWriter> pws, String condition,
			SymbolTable rt, String parent) {
		int level = rt.getLevel();
		if (rt.getStack().size() > 1) {
			String key = rt.getStack().get(1);
			PrintWriter pw = pws.get(key);

			stat_.translate(pws, null, rt, parent);
			if (stat_list_ != null) {
				stat_list_.translate(pws, null, rt, parent);
			}
			return null;
		} else {
			stat_.translate(pws, null, rt, parent);
			if (stat_list_ != null) {
				stat_list_.translate(pws, null, rt, parent);
			}
			return null;
		}
	}

}